import request from '@/config/axios'

// 护工 VO
export interface NurserVO {
  id: number // 主键
  nurserName: string // 护工名称
  nurserLevel: string // 护理等级
  nurserInformation: string // 护工信息
}

// 护工 API
export const NurserApi = {
  // 查询护工分页
  getNurserPage: async (params: any) => {
    return await request.get({ url: `/yyzx/nurser/page`, params })
  },

  // 查询护工详情
  getNurser: async (id: number) => {
    return await request.get({ url: `/yyzx/nurser/get?id=` + id })
  },

  // 新增护工
  createNurser: async (data: NurserVO) => {
    return await request.post({ url: `/yyzx/nurser/create`, data })
  },

  // 修改护工
  updateNurser: async (data: NurserVO) => {
    return await request.put({ url: `/yyzx/nurser/update`, data })
  },

  // 删除护工
  deleteNurser: async (id: number) => {
    return await request.delete({ url: `/yyzx/nurser/delete?id=` + id })
  },

  // 导出护工 Excel
  exportNurser: async (params) => {
    return await request.download({ url: `/yyzx/nurser/export-excel`, params })
  },
}